home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / IDLIncludes / HIImagingObjects.idl < prev    next >
Text File  |  1996-05-01  |  9KB  |  320 lines

  1. /*
  2.      File:        HIImagingObjects.idl
  3.  
  4.      Contains:    Interfaces to image layout and drawing objects.
  5.  
  6.      Version:    Technology:    Copland
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1995-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16. */
  17.  
  18.  
  19.  
  20.  
  21. #ifndef __HIIMAGINGOBJECTS_IDL__
  22. #define __HIIMAGINGOBJECTS_IDL__
  23.  
  24. #include <somobj.idl>
  25. #include <somcls.idl>
  26.  
  27. #include <Collections.idl>
  28. #include <TextCommon.idl>
  29. #include <TextObjects.idl>
  30. #include <Types.idl>
  31. #include <Icons.idl>
  32. #include <Quickdraw.idl>
  33. #include <AppleEvents.idl>
  34. #include <Fonts.idl>
  35. #include <Resources.idl>
  36. #include <HIObjectTypes.idl>
  37. #include <HIImagingObjectTypes.idl>
  38.  
  39.  
  40.  
  41. interface HIImagingObject : SOMObject
  42. {
  43. // ======================================================
  44. // Public Methods
  45. // ======================================================
  46.  
  47.     OSStatus    NewImage( out HIImageRef imageRefPtr );                            
  48.     OSStatus    GetNewImage( in AESubDesc initializer, out HIImageRef imageRefPtr );                            
  49.  
  50.     HIImageRef    CloneImage( in HIImageRef imageRef );
  51.     OSStatus    ReleaseImage( in HIImageRef imageRef );                            
  52.     ItemCount    GetImageOwnerCount (in ConstHIImageRef imageRef );
  53.  
  54.     OSStatus    InitFromAERecord( in HIImageRef imageRef, in AESubDesc dataForBaseClass,
  55.                     in AESubDesc dataForClass, in HIAERecordDataFormat dataFormat);
  56.  
  57.     OSStatus    WriteToAERecord( in ConstHIImageRef imageRef, in AERecord dataForSubclass,
  58.                     in AERecord dataForClass, in HIAERecordDataFormat dataFormat);
  59.                                                                                 
  60.                                                                                     
  61.     OSStatus    MeasureImage( in ConstHIImageRef imageRef, in CGrafPtr port, 
  62.                     out UInt32 widthPtr, out UInt32 heightPtr,
  63.                     in HIImageOptions measureOptions );                            
  64.                     
  65.  
  66.     OSStatus    DrawImage( in ConstHIImageRef imageRef, in CGrafPtr port, 
  67.                     in Rect contentRect, in Rect frameRect /* may be NULL */, 
  68.                     in HIImageOptions drawOptions );                                
  69.  
  70.                     
  71. // ======================================================
  72. // Protected Methods
  73. //  For use only by imaging object implementation
  74. // ======================================================
  75.  
  76.     OSStatus    DisposeImage ( in HIImageRef imageRef );
  77.     
  78. // ======================================================
  79. // Procedural calls
  80. //     These are not object methods, but rather static functions
  81. // ======================================================
  82.  
  83.     // Returns an HIImagingObject of the correct type
  84.     HIImagingObject        GetHIImagingObject(in HIImageType imageType);
  85.  
  86.     // Returns the type of an ImageRef
  87.     HIImageType    GetImageType( in ConstHIImageRef imageRef );
  88.     
  89.     // Make a new typed image ref from data in a resource
  90.     OSStatus    GetNewImageFromResource( in ResID objectInitializerResourceID, out HIImageRef imageRefPtr );                            
  91.     
  92.     
  93.     #ifdef    __SOMIDL__
  94.     implementation {
  95.  
  96.         passthru C_h =     "#include <Collections.h>"
  97.                         "#include <Quickdraw.h>"
  98.                         "#include <TextEdit.h>"
  99.                         "#include <TextObjects.h>"
  100.                         "#include <Types.h>"
  101.                         "#include <Resources.h>"
  102.                         "#include <HIObjectTypes.h>"
  103.                         "#include <HIImagingObjectTypes.h>";
  104.  
  105.         passthru C_xh = "#include <Collections.h>"
  106.                         "#include <Quickdraw.h>"
  107.                         "#include <TextEdit.h>"
  108.                         "#include <TextObjects.h>"
  109.                         "#include <Types.h>"
  110.                         "#include <Resources.h>"
  111.                         "#include <HIObjectTypes.h>"
  112.                         "#include <HIImagingObjectTypes.h>";
  113.     
  114.         GetHIImagingObject:            procedure, noself;
  115.         GetImageType:                procedure, noself;
  116.         GetNewImageFromResource:    procedure, noself;
  117.  
  118.         CloneImage:                    nooverride;
  119.         ReleaseImage:                nooverride;
  120.         GetImageOwnerCount:            nooverride;
  121.  
  122.         releaseorder:    NewImage,
  123.                         DisposeImage,
  124.                         InitFromAERecord,
  125.                         WriteToAERecord,
  126.                         GetImageType,
  127.                         MeasureImage,
  128.                         DrawImage,
  129.                         GetHIImagingObject,
  130.                         GetNewImage,
  131.                         GetNewImageFromResource,
  132.                         CloneImage,
  133.                         ReleaseImage,
  134.                         GetImageOwnerCount;
  135.     };
  136.     #endif
  137. };
  138.  
  139. interface HICompositeImagingObject : HIImagingObject
  140. {
  141. // ======================================================
  142. // Public Methods
  143. // ======================================================
  144.  
  145.     OSStatus    SetImageSize( in HIImageRef imageRef, in UInt16 width, in UInt16 height );    // Same values returned by "MeasureImage"
  146.  
  147.     OSStatus    AddSubImages( in HIImageRef imageRef, in UInt32 index, in UInt32 count );        
  148.     OSStatus    SetSubImage( in HIImageRef imageRef, in UInt32 index, 
  149.                                 in ConstHIImageRef subHIImageRef, in Rect subImageRect, in HIImageOptions options );        
  150.     OSStatus    GetSubImage( in ConstHIImageRef imageRef, in UInt32 index, 
  151.                                 out HIImageRef subHIImageRefPtr, out Rect subImageRect, out HIImageOptions options );        
  152.     
  153.     UInt32        GetSubImageCount( in ConstHIImageRef imageRef );
  154.     
  155.     
  156.     implementation
  157.     {
  158.  
  159.         releaseorder:        SetImageSize,
  160.                             AddSubImages,
  161.                             SetSubImage,
  162.                             GetSubImage,
  163.                             GetSubImageCount;
  164.     };
  165. };
  166.  
  167.  
  168. interface HIIconImagingObject : HIImagingObject
  169. {
  170. // ======================================================
  171. // Public Methods
  172. // ======================================================
  173.  
  174.     OSStatus    SetIcon( in HIImageRef imageRef, in Handle iconSuite );            
  175.     OSStatus    GetIcon( in ConstHIImageRef imageRef, out Handle iconSuitePtr );    
  176.     
  177.     // *** need icon drawing attributes similar to TextStrikeRef
  178.     
  179.     implementation
  180.     {
  181.  
  182.         passthru C_h =     "#include <Collections.h>"
  183.                         "#include <Quickdraw.h>"
  184.                         "#include <TextEdit.h>"
  185.                         "#include <TextObjects.h>"
  186.                         "#include <Types.h>"
  187.                         "#include <HIObjectTypes.h>"
  188.                         "#include <HIImagingObjectTypes.h>";
  189.  
  190.         passthru C_xh = "#include <Collections.h>"
  191.                         "#include <Quickdraw.h>"
  192.                         "#include <TextEdit.h>"
  193.                         "#include <TextObjects.h>"
  194.                         "#include <Types.h>"
  195.                         "#include <HIObjectTypes.h>"
  196.                         "#include <HIImagingObjectTypes.h>";
  197.         
  198.         releaseorder:        SetIcon,
  199.                             GetIcon;
  200.     };
  201. };
  202.  
  203.  
  204.  
  205. interface HIPatternImagingObject : HIImagingObject
  206. {
  207. // ======================================================
  208. // Public Methods
  209. // ======================================================
  210.  
  211.     OSStatus    SetPattern( in HIImageRef imageRef, in PixPatHandle pattern );        
  212.     OSStatus    GetPattern( in ConstHIImageRef imageRef, out PixPatHandle pattern );    
  213.     
  214.     implementation
  215.     {
  216.  
  217.         passthru C_h =     "#include <Collections.h>"
  218.                         "#include <Quickdraw.h>"
  219.                         "#include <TextEdit.h>"
  220.                         "#include <TextObjects.h>"
  221.                         "#include <Types.h>"
  222.                         "#include <HIObjectTypes.h>"
  223.                         "#include <HIImagingObjectTypes.h>";
  224.  
  225.         passthru C_xh = "#include <Collections.h>"
  226.                         "#include <Quickdraw.h>"
  227.                         "#include <TextEdit.h>"
  228.                         "#include <TextObjects.h>"
  229.                         "#include <Types.h>"
  230.                         "#include <HIObjectTypes.h>"
  231.                         "#include <HIImagingObjectTypes.h>";
  232.         
  233.         releaseorder:        SetPattern,
  234.                             GetPattern;
  235.     };
  236. };
  237.  
  238.  
  239. interface HIPictureImagingObject : HIImagingObject
  240. {
  241. // ======================================================
  242. // Public Methods
  243. // ======================================================
  244.  
  245.     OSStatus    SetPicture( in HIImageRef imageRef, in PicHandle picture );            
  246.     OSStatus    GetPicture( in ConstHIImageRef imageRef, out PicHandle picturePtr );    
  247.  
  248.     
  249.     implementation
  250.     {
  251.  
  252.         passthru C_h =     "#include <Collections.h>"
  253.                         "#include <Quickdraw.h>"
  254.                         "#include <TextEdit.h>"
  255.                         "#include <TextObjects.h>"
  256.                         "#include <Types.h>"
  257.                         "#include <HIObjectTypes.h>"
  258.                         "#include <HIImagingObjectTypes.h>";
  259.  
  260.         passthru C_xh = "#include <Collections.h>"
  261.                         "#include <Quickdraw.h>"
  262.                         "#include <TextEdit.h>"
  263.                         "#include <TextObjects.h>"
  264.                         "#include <Types.h>"
  265.                         "#include <HIObjectTypes.h>"
  266.                         "#include <HIImagingObjectTypes.h>";
  267.         
  268.         releaseorder:        SetPicture,
  269.                             GetPicture;
  270.     };
  271. };
  272.  
  273.  
  274. interface HITextImagingObject : HIImagingObject
  275. {
  276. // ======================================================
  277. // Public Methods
  278. // ======================================================
  279.     
  280.     OSStatus    SetText( in HIImageRef imageRef, in TextObject textObject );            
  281.     OSStatus    GetText( in ConstHIImageRef imageRef, out TextObject textObjectPtr );    
  282.  
  283.     OSStatus    SetStrike( in HIImageRef imageRef, in TextStrikeRef strike);
  284.     OSStatus    GetStrike( in ConstHIImageRef imageRef, out TextStrikeRef strike);
  285.     
  286.  
  287.  
  288.     implementation
  289.     {
  290.  
  291.         passthru C_h =     "#include <Collections.h>"
  292.                         "#include <Fonts.h>"
  293.                         "#include <Quickdraw.h>"
  294.                         "#include <TextEdit.h>"
  295.                         "#include <TextObjects.h>"
  296.                         "#include <Types.h>"
  297.                         "#include <HIObjectTypes.h>"
  298.                         "#include <HIImagingObjectTypes.h>";
  299.  
  300.         passthru C_xh = "#include <Collections.h>"
  301.                         "#include <Fonts.h>"
  302.                         "#include <Quickdraw.h>"
  303.                         "#include <TextEdit.h>"
  304.                         "#include <TextObjects.h>"
  305.                         "#include <Types.h>"
  306.                         "#include <HIObjectTypes.h>"
  307.                         "#include <HIImagingObjectTypes.h>";
  308.  
  309.         releaseorder:        SetText,
  310.                             GetText,
  311.                             SetStrike,
  312.                             GetStrike,
  313.                             TextImageMgr__reserved0,
  314.                             TextImageMgr__reserved1;
  315.     };
  316. };
  317.  
  318.  
  319. #endif
  320.